<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="util.*" %>
<%@ page import="model.*" %>
<%@ page import="control.*" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head> 
	<link href="../../../resources/css/admin/pages_subpage.css" rel="stylesheet" type="text/css"/>
  <style>
  <!--
		table.form{
			border-collapse:collapse;
		}
		table.forms td{
			padding:5px;
			border:1px solid #00bfff;
		}
		table.forms td.items{
			background:#87cefa;
		}
		
		input,select,textarea{
			border:1px #778899 solid;
		}
	-->
  </style>
		<title>pic_update.jsp</title>
	</head>
	<script language="javascript"> 
	function check()
		{
			    if(document.form1.pic_path.value=="")
				{
					alert("图片不能为空");
					document.form1.pic_path.focus();
					return;
				}
				else
				{form1.submit();}
		} 
		</script>
	<script type="text/javascript">
        var popUpWin = 0;
        function PopUpWindow(URLStr, left, top, width, height, newWin, scrollbars) {
            if (typeof (newWin) == "undefined")
                newWin = false;

            if (typeof (left) == "undefined")
                left = 100;

            if (typeof (top) == "undefined")
                top = 0;

            if (typeof (width) == "undefined")
                width = 800;

            if (typeof (height) == "undefined")
                height = 760;

            if (newWin) {
                open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
                return;
            }
            if (typeof (scrollbars) == "undefined") {
                scrollbars = 0;
            }
            if (popUpWin) {
                if (!popUpWin.closed) popUpWin.close();
            }
            popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
            popUpWin.focus();
        }
</script>

	<body>

		<%
			request.setCharacterEncoding("utf-8");
			int id = ParamUtil.getInt(request,"pic_id");
			ScrollPic pic = new ScrollPic();
			pic = ScrollPicControl.getScrollPic(id);
			String Picurl = (String) session.getAttribute("picUrl");
			if (Picurl == null) {
				Picurl = pic.getPic();
			}
		%>
		<form action="pic_update_chuli.jsp?pic_id=<%=id%>" name="form1" method="post">
			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="forms">
				<tr>
					<td width="150" class="items">
						请先上传图片（不可以为空）
					</td>
					<td class="left">
						<input name="pic_path" type="hidden" size="5" value=<%=Picurl%> />
						<%
							System.out.println(Picurl); 
						%>
						<input type="button" value="点击上传照片"
							onclick="javascript:void(0);PopUpWindow('../uploadimage.jsp?Picurl=<%=Picurl%>',100,100,600,500);" />
					</td>
				</tr>
				<tr>
					<td class="items">
						<img src="../../../resources/photos/<%=Picurl%>" width="120" height="150"
							alt="" />
					</td>
				</tr>
				<tr>
					<td class="items">
						图片描述：
					</td>
					<td class="left">
					    <input type="text" name="pic_introduction" id="pic_introduction" value="<%=pic.getDescription()%>" />
					</td>
				</tr>
				<tr>
    				<td class="items">&nbsp;</td>
    				<td class="left">
    					<input type="button" name="button2" value="提交" onClick="check()" />&nbsp;&nbsp;&nbsp;&nbsp;
     					 <input type="reset" name="Reset" value="重置" />
    				</td>
 			    </tr>
			</table>
		</form>
	</body>
</html>
